<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>mamma</title>
<link rel="shortcut icon" href="../image/icon_mamma.ico">

<script src="../js/jquery-2.1.1.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
<script type ="text/javascript" src ="../js/jquery.columns-1.0.min.js"></script>
<link id="style" href="../css/clean.css" rel="stylesheet" media="screen">

<script type="text/javascript">

$(document).ready(function() {
	
	listDiv();
	
	 $('#write').on('click',gowrite); 
	 
	 $('#main').on('click',gomain); 
	 
	

});


function listDiv(){
	
	$.ajax({
		url : 'gList.action',
		type : 'POST',
		dataType : 'json', 	
		success:function(json) { 
			list = $('#listDiv').columns({
				data:json.list,
				schema: [
					{"header":"공지번호", "key":"id"},
					{"header":"제목", "key":"infoName" , "template":'<a href="<s:url value="read.action?id="/>{{id}}">{{infoName}}</a>'},
					{"header":"중요도", "key":"importance"}
				]

			}); 
		}
	}); 
	
}
	
function gowrite(){
	location.href="../admin/goNoticePage.action";
}


function gomain(){
	location.href='../admin/goAdminPage.action';
}

</script>

</head>
<body topmargin="0"  leftmargin="0" rightmargin="0">
<table id="adhead" border="0" width="100%" height="100px" style="text-align: center;background-color: #EAEAEA;">
<tr>
<td>	
	<a href="../admin/goNoticelistPage.action">공지 관리</a>
	<a href="../admin/goJusalistPage.action">백신 알림</a>
	<a href="../admin/goMemberlistPage.action">회원 목록 보기</a>
	<a href="../admin/goAdBannerPage.action">광고 관리</a>
	<a href="../account/logout.action">로그아웃</a>
</td>
</tr></table>
<h1 style="text-align: center;">[공지]</h1> 



<div id="listDiv" style="margin:0 auto; width: 900px;">
</div>


<br>
<form style="text-align: center;">
<input type="button" id="write" value="새공지쓰기"> 
<input type="button" id="main" value="메인으로">
</form>
</body>
</html>